package com.xuecheng.content.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xuecheng.content.entity.Teachplan;
import com.xuecheng.content.entity.ex.TeachplanNode;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 课程计划 Mapper 接口
 * </p>
 *
 * @author itcast
 */
public interface TeachplanMapper extends BaseMapper<Teachplan> {
    List<TeachplanNode> queryTreeNodesByCourseBaseId(Long CourseBaseId);

    @Select("SELECT IFNULL(MAX(orderby),0)  FROM teachplan WHERE course_id = #{courseId} AND parentid = #{id}")
    Integer queryOrderby(@Param("courseId") Long courseId, @Param("id") Long id);
}
